#ifndef _CONFIG_HPP_20120608
#define _CONFIG_HPP_20120608

#include <string>

using namespace std;

class ConfigImpl;

class Config
{
public:
    Config();
    ~Config();
    int load(const string& cfg_file);
    int store();
    int get_int_param(const string& section, const string& param_name, int& value);
    int get_double_param(const string& section, const string& param_name,  double& value);
    int get_string_param(const string& section, const string& param_name, string& value);
	int get_time_param(const string & section,const string & param_name,int &second);
	int get_ulong_param(const string & section,const string & param_name,unsigned long &value);
    int set_int_param(const string& section, const string& param_name, int value);
    int set_double_param(const string& section, const string& param_name,  double value);
    int set_string_param(const string& section, const string& param_name, string& value);
    int delete_param(const string& section, const string& param_name);

    int load(const char* cfg_file);
    int get_int_param(const char* section, const char* param_name, int& value);
    int get_double_param(const char* section, const char* param_name,  double& value);
    int get_string_param(const char* section, const char* param_name, string& value);
    int set_int_param(const char* section, const char* param_name, int value);
    int set_double_param(const char* section, const char* param_name,  double value);
    int set_string_param(const char* section, const char* param_name, string& value);
    int delete_param(const char* section, const char* param_name);
	void show();
private:
    ConfigImpl* _impl;
};

#endif
